/*
 * @Author: your name
 * @Date: 2021-05-08 21:20:59
 * @LastEditTime: 2021-05-08 21:31:23
 * @LastEditors: your name
 * @Description: In User Settings Edit
 * @FilePath: \finance-front\src\config\filter.js
 */
// 全局过滤器
import Vue from "vue";

/*流程状态*/
Vue.filter("stepStatus", (status) => {
  switch (status) {
    case "Started":
      status = "已发起";
      break;
    case "Pending":
      status = "待审核";
      break;
    case "Rejected":
      status = "已拒绝";
      break;
    case "nostart":
      status = "未开始";
      break;
    case "Recalled":
      status = "重启";
      break;
    case "Approved":
      status = "已同意";
      break;
    case "ReAssign":
      status = "重新分配";
      break;
    case "":
      status = "";
      break;
  }
  return status;
});
// 流程类型
Vue.filter("piType", (status) => {
  switch (status) {
    case "1":
      status = "签单申请";
      break;
    case "2":
      status = "重启申请";
      break;
    case "3":
      status = "转单申请";
      break;
    case "4":
      status = "转类型申请";
      break;
    case "5":
      status = "多后台申请";
      break;
    case "6":
      status = "服务费优惠申请";
      break;
    case "7":
      status = "费用报销";
      break;
    case "8":
      status = "前台借出";
      break;
    case "9":
      status = "后台借出";
      break;
    case "10":
      status = "结账单";
      break;
    case "11":
      status = "问题单";
      break;
    case "12":
      status = "特殊费用报销";
      break;
    case "13":
      status = "渠道返佣点数修改";
      break;
    case "14":
      status = "退单申请";
      break;
    case "15":
      status = "中介返佣单";
      break;
  }
  return status;
});
/*退费类型*/
Vue.filter("returnType", (status) => {
  switch (status) {
    case 1:
      status = "定金";
      break;
    case 2:
      status = "服务费";
      break;
    case 4:
      status = "前台其他费";
      break;
  }
  return status;
});
/*审核状态*/
Vue.filter("approvalStatus", (status) => {
  switch (status) {
    case "0":
      status = "审核中";
      break;
    case "1":
      status = "审核通过";
      break;
    case "2":
      status = "审核拒绝";
      break;
    case "":
      status = "";
      break;
  }
  return status;
});

/*特殊单类型*/
Vue.filter("specialType", (status) => {
  switch (status) {
    case 1:
      status = "多后台申请";
      break;
    case 2:
      status = "转单申请";
      break;
    case 3:
      status = "转类型申请";
      break;
    case 4:
      status = "重启申请";
      break;
    case 5:
      status = "服务费优惠申请";
      break;
  }
  return status;
});
/*客户等级*/
Vue.filter("customerLevel", (status) => {
  switch (status) {
    case "A":
      status = "A";
      break;
    case "B":
      status = "B";
      break;
    case "C":
      status = "C";
      break;
    case "D":
      status = "D";
      break;
    case "E":
      status = "无等级";
      break;
    case "F":
      status = "签单";
      break;
    case "F":
      status = "非签单";
      break;
  }
  return status;
});

/*贷款意向*/
Vue.filter("loanInterest", (status) => {
  switch (status) {
    case "A":
      status = "房贷";
      break;
    case "B":
      status = "信贷";
      break;
    case "C":
      status = "顺位";
      break;
    case "D":
      status = "经营贷";
      break;
    case "F":
      status = "放大贷";
      break;
  }
  return status;
});
/*权重类型*/
Vue.filter("tag", (status) => {
  switch (status) {
    case 0:
      status = "部门";
      break;
    case 1:
      status = "人员";
      break;
  }
  return status;
});
/*数据来源*/
Vue.filter("dataFrom", (status) => {
  switch (status) {
    case "A":
      status = "电台";
      break;
    case "B":
      status = "网络A";
      break;
    case "C":
      status = "网络B";
      break;
  }
  return status;
});
/* 贷款类型*/
Vue.filter("loanType", (status) => {
  switch (status) {
    case "A":
      status = "房贷";
      break;
    case "B":
      status = "信贷";
      break;
    case "C":
      status = "顺位";
      break;
    // case "D":
    //   status = "经营贷";
    //   break;
    // case "F":
    //   status = "放大贷";
    //   break;
  }
  return status;
});
/* 还款方式*/
Vue.filter("reimbursement", (status) => {
  switch (status) {
    case "A":
      status = "等额本金";
      break;
    case "B":
      status = "等额本息";
      break;
    case "C":
      status = "先息后本";
      break;
    case "D":
      status = "随借随还";
      break;
    case "E":
      status = "计划还款";
      break;
    case "":
      status = "";
      break;
  }
  return status;
});
/*反馈评级*/
Vue.filter("feedback", (status) => {
  switch (status) {
    case "A":
      status = "资质好";
      break;
    case "B":
      status = "资质一般";
      break;
    case "C":
      status = "资质差";
      break;
    case "D":
      status = "未接";
      break;
    case "E":
      status = "无意向";
      break;
  }
  return status;
});
/*土地性质*/
Vue.filter("nature", (status) => {
  switch (status) {
    case "A":
      status = "出让";
      break;
    case "B":
      status = "划拨";
      break;
    case "C":
      status = "无国土证";
      break;
  }
  return status;
});
/*所有方式*/
Vue.filter("ownership", (status) => {
  switch (status) {
    case "A":
      status = "单独所有";
      break;
    case "B":
      status = "共同所有";
      break;
    case "C":
      status = "按份所有";
      break;
  }
  return status;
});
/*是否抵押*/
Vue.filter("mortgage", (status) => {
  switch (status) {
    case "1":
      status = "是";
      break;
    case "0":
      status = "否";
      break;
  }
  return status;
});
/*有无计划*/
Vue.filter("plan", (status) => {
  switch (status) {
    case 1:
      status = "有";
      break;
    case 0:
      status = "无";
      break;
  }
  return status;
});
/*计划类型*/
Vue.filter("planType", (status) => {
  switch (status) {
    case "A":
      status = "电话计划";
      break;
    case "B":
      status = "上门计划";
      break;
    case "C":
      status = "其他计划";
      break;
    case "D":
      status = "系统计划";
      break;
    case "E":
      status = "生日计划";
      break;
    case "F":
      status = "催款计划";
      break;
  }
  return status;
});
/*计划状态*/
Vue.filter("planStatus", (status) => {
  switch (status) {
    case "A":
      status = "未完成";
      break;
    case "B":
      status = "已完成";
      break;
    case "C":
      status = "待完成";
      break;
    case "D":
      status = "过期";
      break;
  }
  return status;
});
/*转移方式*/
Vue.filter("transferMode", (status) => {
  switch (status) {
    case "A":
      status = "领取";
      break;
    case "B":
      status = "手动回退";
      break;
    case "F":
      status = "手动回退";
      break;
    case "G":
      status = "手动回退";
      break;
    case "H":
      status = "手动回退";
      break;
    case "J":
      status = "手动回退";
      break;
    case "C":
      status = "自动回退";
      break;
    case "D":
      status = "分配";
      break;
    case "E":
      status = "回收";
      break;
  }
  return status;
});
/*做单步骤*/
Vue.filter("channelStatus", (status) => {
  switch (status) {
    case "A":
      status = "未开始";
      break;
    case "B":
      status = "操作中";
      break;
    case "C":
      status = "过件";
      break;
    case "D":
      status = "暂缓";
      break;
    case "E":
      status = "放款";
      break;
    case "F":
      status = "关闭";
      break;
    //
    case "I":
      status = "评估";
      break;
    case "J":
      status = "签申请";
      break;
    case "K":
      status = "完善资料";
      break;
    case "L":
      status = "报审";
      break;
    case "N":
      status = "结案";
      break;
    case "O":
      status = "签合同";
      break;
    case "P":
      status = "办抵押";
      break;

  }
  return status;
});
/*权限类型*/
Vue.filter("authorityStuats", (status) => {
  switch (status) {
    case "0":
      status = "菜单";
      break;
    case "1":
      status = "子菜单";
      break;
    case "2":
      status = "按钮";
      break;
    case "3":
      status = "数据";
      break;
  }
  return status;
});
/*费用类别*/
Vue.filter("feeType", (status) => {
  switch (status) {
    case '1':
      status = "前台";
      break;
    case '2':
      status = "后台";
      break;
    case '3':
      status = "催收基金";
      break;
    case '4':
      status = "营业执照费用";
      break;
    case '5':
      status = "报税";
      break;
  }
  return status;
});
/*原件状态*/
Vue.filter("status", (status) => {
  switch (status) {
    case 1:
      status = "收录";
      break;
    case 2:
      status = "借出";
      break;
    case 3:
      status = "抵押";
      break;
    case 4:
      status = "不归还";
      break;
  }
  return status;
});
// 签单状态
Vue.filter("signStatus", (status) => {
  switch (status) {
    case "A":
      status = "未开始/未分配";
      break;
    case "B":
      status = "操作中";
      break;
    case "C":
      status = "过件";
      break;
    case "D":
      status = "暂缓";
      break;
    case "E":
      status = "放款";
      break;
    case "F":
      status = "退单";
      break;
    case "G":
      status = "退信息部";
      break;
  }
  return status;
});

// 特殊单
Vue.filter("teShuType", (status) => {
  switch (status) {
    case 1:
      status = "未签协议";
      break;
    case 2:
      status = "中介报备";
      break;
    case 3:
      status = "正常";
      break;
  }
  return status;
});
// 原件状态
Vue.filter("documentStatus", (status) => {
  switch (status) {
    case '1':
      return "后台";

    case '2':
      return "退信息部";

    case '3':
      return "销毁";

    case '4':
      return "领取";
    case '5':
      return "24小时退件";
    case '6':
      return "退信息部待审";
  }
  return status;
});